﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Yipusoft.SixAcquaint.Model;
using Yipusoft.SixAcquaint.BLL;

public partial class BasicBase_WaterSource_ViewWater : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (Yipusoft.Account.BLL.User.HasPermission(User.Identity.Name, "200800") || Yipusoft.Account.BLL.User.HasPermission(User.Identity.Name, "200804"))
            {
                if (!string.IsNullOrEmpty(Request["ID"]))
                {
                    WaterInfo waterDetails = Water.GetWaterByID(Request["ID"]);
                    lblBH.Text = waterDetails.WaterBH;
                    lblDepartment.Text = waterDetails.DepartmentName;
                    lblGJ.Text = waterDetails.GuanJing.ToString();
                    lblGZh.Text = waterDetails.GuanZhuang;
                    lblJD.Text = waterDetails.JingDu.ToString();
                    lblKouJing1.Text = waterDetails.KouJing1.ToString();
                    lblKouJing2.Text = waterDetails.KouJing2.ToString();
                    lblLocation.Text = waterDetails.Location;
                    lblMemo.Text = waterDetails.Memo;
                    lblStatus.Text = waterDetails.Workable ? "可用" : "不可用";
                    lblWD.Text = waterDetails.WeiDu.ToString();
                    lblYL.Text = waterDetails.Pressure.ToString();
                }
            }
            else
            {
                Response.Write("<script>alert('没有权限！');history.back(0);</script>");
                return;
            }
        }
    }
}
